package servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;

import pojo.MerchantApplication;
import service.MerchantApplicationManager;
import service.impl.MerchantApplicationManagerImpl;
import util.JsonUtil;
import dto.AdminMerchantDto;
import dto.ResponseDto;

public class LoadAllMerchantServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private MerchantApplicationManager aManager = null;
	Logger logger = LogManager.getLogger(LoadAllMerchantServlet.class);
	
    public LoadAllMerchantServlet() {
        super();
        aManager = new MerchantApplicationManagerImpl();
    }
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		List<MerchantApplication> merchants = aManager.getAll();
		request.setAttribute("merchants", merchants);
		request.getRequestDispatcher("../merchantInfo.jsp").forward(request, response);
	}
}
